//
//  BTSendData.h
//  BTDemo
//
//  Created by Avery on 14-8-22.
//  Copyright (c) 2014年 Alvin. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, BTSendDataCallBack)
{
    BTSendDataCallBackContinue = 0,
    BTSendDataCallBackFinish,
    BTSendDataCallBackIgnore,
    BTSendDataCallBackTimeout,
};

@protocol BTResponse <NSObject>
- (id)getInstanceWithNSDatas:(NSArray *)datas;
@end

typedef BTSendDataCallBack(^BTSendDataCompletion_NSData)(NSData *);
typedef void(^BTSendDataCompletion_Error_Object)(NSError *error,NSData *);
@interface BTSendData : NSObject

@property (nonatomic, assign) NSTimeInterval    responseTimeout; // 响应超时
@property (nonatomic, retain) NSString         *characteristic;  // TX字段
@property (nonatomic, retain) NSData           *value;           // 发送内容
@property (nonatomic, retain) id<BTResponse>   responseModel;   // 返回实体类
@property (nonatomic, retain) NSMutableArray   *responseDatas;   // 响应数据数组

/* 回调 */
@property (nonatomic, copy) BTSendDataCompletion_NSData        verifyCallBack;    //验证回调
@property (nonatomic, copy) BTSendDataCompletion_Error_Object  responseCallBack;  //响应回调

- (id)initWithCmdData:(NSData *) data;

- (void)callBackResponseModel;

@end
